#import late_command
#if $str($getVar('puppet_auto_setup','')) == "1"
in-target mkdir -p /etc/puppet /var/lib/hiera && \
in-target touch /var/lib/hiera/common.yaml /etc/puppet/hiera.yaml && \
    #if $getVar('puppet_master','') != ''
in-target $late_command.late_file("""[main]
    logdir = /var/log/puppet
    rundir = /var/run/puppet
    ssldir = $vardir/ssl
    pluginsync = true
[agent]
    classfile = $vardir/classes.txt
    localconfig = $vardir/localconfig
    server = %(puppet_master)s
    report = false
    configtimeout = 600
""" % {"puppet_master": $puppet_master},
    "/etc/puppet/puppet.conf", source_method="content") \
    #else
true \
    #end if
#end if
